package com.cxj.lejia;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;

public class DescActivity extends Activity {
    private WebView mWebView;
    private Button returnButton;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.desc);

        Bundle bundle = getIntent().getExtras();
        final int idx = bundle.getInt("index");

        String appname = getResources().getString(R.string.app_name);
        //设置标题
        String title = getResources().getString(DetailActivity.buttionTextIds[idx]);
        setTitle(title + "-" + appname);
       
        mWebView = (WebView) findViewById(R.id.myWebView);

        WebSettings webSettings = mWebView.getSettings();
        webSettings.setDefaultTextEncodingName("UTF-8");
        mWebView.loadUrl("file:///android_asset/result" + idx + ".html");

        returnButton = (Button) findViewById(R.id.return_Button);
        returnButton.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View arg0) {
                finish();
            }
        });
    }

    @Override
    protected void onDestroy() {
        mWebView.destroy();
        super.onDestroy();
    }
}